<?php
	require_once("connect.php");
	function LoadDSPhong()
	{
		try
		{
			$sql="select maphong,tenphong from phong";
			
			$result=$conn->prepare($sql,array(PDO::ATTR_CURSOR => PDO::CURSOR_SCROLL));
			$result->execute();
			if($result->rowCount()==0)
				echo "<script>alert('Không có Phòng');</script>"; 
			while($row=$result->fetch(PDO::FETCH_ASSOC))
			{
				
				echo "<option>".$row["tenphong"]."</option>";
			}
			$result=null;
				
		}
		catch(Exception $ex)
		{ 
			echo "Error in query preparation/execution.<br/>".print_r( $ex->getMessage(), true);
		}
	}
?>
